
package beans;

import java.beans.EventSetDescriptor;
import java.beans.IntrospectionException;
import java.beans.MethodDescriptor;
import java.beans.ParameterDescriptor;
import java.beans.PropertyDescriptor;
import java.beans.SimpleBeanInfo;
import java.lang.reflect.Method;
import java.util.logging.Level;
import java.util.logging.Logger;

import Listeners.ImageListener;

/**
 *
 * @author Benjamin
 */
public class SourceBeanBeanInfo extends SimpleBeanInfo {
    
    @Override
    public PropertyDescriptor[] getPropertyDescriptors() {
        try {
            PropertyDescriptor source;
            source = new PropertyDescriptor("sourceImage", SourceBean.class);
            source.setDisplayName("Source-Image Path:");
            PropertyDescriptor pd[] = { source };
            return pd;
        }
        catch(Exception ex) {
            ex.printStackTrace();
        }
        return null;
    }
    
        
    @Override
    public EventSetDescriptor[] getEventSetDescriptors(){
        
        try {
            String mnames[] = {"onImageProceed"};
            EventSetDescriptor esd = new EventSetDescriptor(SourceBean.class, "image",
                    ImageListener.class, mnames, "addImageListener", "removeImageListener");
            
            EventSetDescriptor[] rv = {esd};
            
            return rv;
            
        } catch (IntrospectionException ex) {
            Logger.getLogger(SourceBean.class.getName()).log(Level.SEVERE, null, ex);
        }
        return null;
    }
    

}
